using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

using Padelcenter.Operational;

namespace Padelcenter.DataAccess
{
    public class DataAccessBase
    {
        #region Private Vars

        private string _storedprocedureName;

        #endregion

        #region Properties

        public string StoredProcedureName
        {
            get { return _storedprocedureName; }
            set { _storedprocedureName = value; }
        }

        protected string ConnectionString
        {
            get
            {
                return ConfigurationManager.ConnectionStrings["connPadelcenter"].ToString();
            }
        }
        #endregion

        #region Public Methods

        public string ConnString(string key)
        {
            Config oConfig = null;
            try
            {
                oConfig = new Config();
                return oConfig.ConnString(key);
            }
            catch (Exception e)
            {
                // Common Exception
                throw (new Exception("DataAccess.ConnString: " + e.Message.ToString()));
            }
            finally
            {
                oConfig = null;                
            }
        }

        #endregion
    }
}
